import Vue from "vue";
import Vuex from "vuex";
// import {createVuexPersistedState} from "vue-persistedstate"
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    userInfo: {},
    timeArrary: [],
  },
  getters: {},
  mutations: {
    TIMERCHANGES(state, val) {
      state.timeArrary = val;
    },
  },
  actions: {
    timechanges({ commit }, val) {
      commit("TIMERCHANGES", val);
    },
  },
  modules: {},

  //   plugins:[
  //     createVuexPersistedState({
  //         // 缓存的key
  //         key:"你保存缓存时用的key名称",
  //         // 使用的什么缓存
  //         storage:window.localStorage, // window.sessionStorage
  //         reducer(val) {
  //        return val
  //         }
  //     })
  // ]
});
